<template>
  <div>
    <div class="nav-block"></div>
    <div class="nav">
      <div class="nav-l">
        <img src="https://img.nengyuan.shop/mobile/logo_108.png" alt="logo" class="logo" onclick="window.location.href='/energy_cloud_computing'">
        <span class="p-title">{{title}}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Nav',
  props: {
    title: {
      type: String,
      default: '储能收益 - MecKey能源商城'
    }
  }
}
</script>

<style scoped>
  .nav-block {
    height: 46px;
  }
  .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #FFFFFF;
    z-index: 99999;
    border-bottom: 1px solid #eeeeee;
  }

  .nav .logo {
    height: 45px;
    width: 46px;
    display: block;
  }

  .nav .menu, .nav .search, .nav .login {
    height: 46px;
    width: 46px;
    display: block;
    text-align: center;
    line-height: 46px;
    font-size: 22px;
    font-weight: bold;
    color: #898989;
  }

  .nav .login {
    height: 46px;
    width: 46px;
    display: block;
    text-align: center;
    line-height: 46px;
    font-size: 14px;
    font-weight: normal;
    color: #0090FF;
    text-decoration: none;
    box-sizing: border-box;
  }

  .nav .search {
    font-size: 18px;
  }

  .nav .search-container {
    width: calc(100% - 92px);
    height: 45px;
    background-color: #FFFFFF;
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: #8E8E8E;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
  }

  .nav .search-container.nologin {
    width: calc(100% - 138px);
  }

  .nav .search-container i {
    margin-right: 6px;
  }

  .nav .nav-r {
    display: flex;
    align-items: center;
  }

  .nav .nav-l {
    display: flex;
    align-items: center;
  }

  .nav .p-title {
    display: block;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #434343;
    font-weight: bold;
    height: 45px;
    border-left: 1px solid #EEEEEE;
    line-height: 45px;
    padding-left: 10px;
  }
</style>
